home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
bluep.swf
/
scripts
/
__Packages
/
Bullet.as
next >
Wrap
Text File
|
2013-04-24
|
2KB
|
59 lines
class Bullet extends MovieClip
{
function Bullet()
{
super();
this.moveX = 0;
this.moveY = 0;
this._damage = 1;
this._holdMovement = false;
}
function SetMovement(myX, myY)
{
this.moveX = myX;
this.moveY = myY;
}
function onEnterFrame()
{
if(this._holdMovement == false)
{
this._x += this.moveX;
this._y += this.moveY;
this.outOfBounds();
if(this._enemy)
{
this.ifHitAvatar();
}
}
}
function ifHitAvatar()
{
if(this.hitTest(_root.pointer.pointerBody))
{
if(_root.playerLives >= 2)
{
var _loc4_ = "shield_hits2" + _root.getNextHighestDepth();
var _loc5_ = 1 + Math.floor(Math.random() * 360);
_root.attachMovie("shield_hits2",_loc4_,_root.getNextHighestDepth());
_root[_loc4_]._rotation = _root.pointer._rotation + _loc5_;
_root[_loc4_]._x = this._x;
_root[_loc4_]._y = this._y;
}
this.removeCallback(this._name);
this.removeMovieClip();
if(!_global.shieldOn)
{
_root.adjustLives();
}
}
}
function outOfBounds()
{
if(this._x < -50 || this._x > 550 || this._y < -50 || this._y > 550 || _global.pauseClicked)
{
this.removeCallback(this._name);
this.removeMovieClip();
}
}
}